using System;
using System.Collections.Generic;
using System.Text;
using Castle.MonoRail.Framework.Extensions.Session;
using Enyim.Caching;
using System.Collections.Specialized;
using Enyim.Caching.Memcached;
using System.Collections;

namespace AjileJedi.MemcachedForMonorail.CustomSessionStateExtensions
{
	public class MemCacheSessionFactory : ICustomSessionFactory
	{
		#region ICustomSessionFactory Members

		System.Collections.IDictionary ICustomSessionFactory.ObtainSession(Castle.MonoRail.Framework.IRailsEngineContext context)
		{

			return (IDictionary)new MemCachedSessionDictionary(context.UnderlyingContext.Session.SessionID);

		}

		void ICustomSessionFactory.PersistSession(System.Collections.IDictionary session, Castle.MonoRail.Framework.IRailsEngineContext context)
		{
			return;
		}

		#endregion
	}
}